/***************************************************************
 *  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
 *  All rights reserved
 *
 *  This file is part of the GroupMe! Project. You can utilize
 *  software of the GroupMe! project under the terms of the 
 *  GNU Lesser General Public License as published by the
 *  Free Software Foundation in version 2.1.
 * 
 *  The GNU Lesser General Public License can be found at:
 *  http://www.gnu.org/licenses/lgpl.html
 *
 *  This copyright notice MUST APPEAR in all copies of the file!
 ***************************************************************/
package net.groupme.model;

import java.net.URI;
import java.util.Collection;

import net.groupme.exceptions.DeleteFailedException;
import net.groupme.exceptions.InsertFailedException;
import net.groupme.exceptions.UpdateFailedException;
import net.groupme.model.dao.GroupVisualizationDAO;

/**
 * This class defines a GroupVisualization
 * {@link net.groupme.model.GroupVisualization} object for the GroupMe! Project.
 * created on 16.04.2007
 * 
 * @author Mischa Frank <a
 *         href="mailto:code@planetfrank.net">code@planetfrank.net</a>
 * 
 * @version 0.1
 * 
 */
public class GroupVisualizationImpl implements GroupVisualization {

	private GroupVisualizationDAO visualizationDAO = null;

	public GroupVisualizationImpl(GroupVisualizationDAO visualizationDAO) {
		this.visualizationDAO = visualizationDAO;
	}

	/* (non-Javadoc)
	 * @see net.groupme.model.Identifiable#getId()
	 */
	public String getId() {
		return this.visualizationDAO.getId();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#addResourceVisualization(net.groupme.model.ResourceVisualization)
	 */
	public void addResourceVisualization(
			ResourceVisualization resourceVisualization)
			throws UpdateFailedException {
		this.visualizationDAO.addResourceVisualization(resourceVisualization);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#addUser(java.lang.String,
	 *      net.groupme.model.User)
	 */
	public void addUser(String role, User user) throws InsertFailedException {
		this.visualizationDAO.addUser(role, user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.Identifiable#getDescription()
	 */
	public String getDescription() {
		return this.visualizationDAO.getDescription();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getGroup()
	 */
	public Group getGroup() {
		return this.visualizationDAO.getGroup();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.Identifiable#getLabel()
	 */
	public String getLabel() {
		return this.visualizationDAO.getLabel();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getName()
	 */
	public String getName() {
		return this.visualizationDAO.getName();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getResourceVisualizations()
	 */
	public Collection<ResourceVisualization> getResourceVisualizations() {
		return this.visualizationDAO.getResourceVisualizations();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getStyle()
	 */
	public Style getStyle() {
		return this.visualizationDAO.getStyle();
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getThumbnail()
	 */
	public String getThumbnail() {
		return this.visualizationDAO.getThumbnail();
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.Identifiable#getURI()
	 */
	public URI getURI() {
		return this.visualizationDAO.getURI();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getUser(java.lang.String)
	 */
	public Collection<User> getUser(String role) {
		return this.visualizationDAO.getUser(role);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#getUsers()
	 */
	public Collection<User> getUsers() {
		return this.visualizationDAO.getUsers();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#removeResourceVisualization(net.groupme.model.ResourceVisualization)
	 */
	public void removeResourceVisualization(
			ResourceVisualization resourceVisualization)
			throws DeleteFailedException {
		this.visualizationDAO
				.removeResourceVisualization(resourceVisualization);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#removeUser(net.groupme.model.User)
	 */
	public void removeUser(User user) throws DeleteFailedException {
		this.visualizationDAO.removeUser(user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.Identifiable#setDescription(java.lang.String)
	 */
	public void setDescription(String description) throws UpdateFailedException {
		this.visualizationDAO.setDescription(description);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#setGroup(net.groupme.model.Group)
	 */
	public void setGroup(Group group) {
		this.visualizationDAO.setGroup(group);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.Identifiable#setLabel(java.lang.String)
	 */
	public void setLabel(String label) {
		this.visualizationDAO.setLabel(label);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#setName(java.lang.String)
	 */
	public void setName(String name) throws UpdateFailedException {
		this.visualizationDAO.setName(name);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#setStyle(net.groupme.model.Style)
	 */
	public void setStyle(Style style) throws UpdateFailedException {
		this.visualizationDAO.setStyle(style);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see net.groupme.model.GroupVisualization#setThumbnail(java.lang.String)
	 */
	public void setThumbnail(String url) throws UpdateFailedException {
	this.visualizationDAO.setThumbnail(url);
		
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return this.visualizationDAO.toString();
	}
}
